//
//  GeRenDetailsViewController.m
//  GuoBang
//
//  Created by fengshuai on 16/4/28.
//  Copyright © 2016年 梧桐树. All rights reserved.
//

#import "GeRenDetailsViewController.h"

@interface GeRenDetailsViewController ()<UITextFieldDelegate>
{
  
}
@end

@implementation GeRenDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupNVA];
    [self setupUI];
    [self setupData];
    
    
    
}

- (void)setupNVA
{
    self.title=self.mytitle;
    //设置返回按键
    //返回按键颜色
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    //返回按键图标
    [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)
                                                         forBarMetrics:UIBarMetricsDefault];
}

- (void)leftAction:(UIBarButtonItem *)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)setupData
{
  
    
    
}

- (void)setupUI
{
    self.view.backgroundColor = RGBCOLOR(245, 245, 245);
    self.deteminBtn.layer.cornerRadius = 5;
    self.deteminBtn.layer.masksToBounds = YES;
    [self.deteminBtn addTarget:self action:@selector(deteminAction:) forControlEvents:UIControlEventTouchUpInside];
    self.titleLabel.text = [NSString stringWithFormat:@"%@:",self.mytitle];
    self.detailsTF.delegate = self;
    
    
}


- (void)deteminAction:(UIButton *)sender
{
    
    [self.delegate sendbackStr:self.detailsTF.text flag:self.flag];
    [self.navigationController popViewControllerAnimated:YES];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}


-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}








@end
